//
//  HeadCollectionViewOfHappyGiven.m
//  Beauty
//
//  Created by Snow on 16/9/2.
//  Copyright © 2016年 Snow. All rights reserved.
//

#import "HeadCollectionViewOfHappyGiven.h"
#import "GXMacro.h"

@interface HeadCollectionViewOfHappyGiven ()
@property (nonatomic, strong) UIView *viewOfLabel;
@end
@implementation HeadCollectionViewOfHappyGiven
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _image = [[UIImageView alloc] init];
        _labelOfPrice = [[UILabel alloc] init];
        _labelOfContent = [[UILabel alloc] init];
        _viewOfLabel = [[UIView alloc] init];
        [self.contentView addSubview:_image];
        [self.contentView addSubview:_viewOfLabel];
        [self.contentView addSubview:_labelOfPrice];
        [self.contentView addSubview:_labelOfContent];
        self.contentView.layer.masksToBounds = YES;
        self.contentView.layer.cornerRadius = 10;
        _viewOfLabel.backgroundColor = [UIColor colorWithWhite:0.500 alpha:0.500];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    [_image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.contentView.mas_left);
        make.right.mas_equalTo(self.contentView.mas_right);
        make.top.mas_equalTo(self.contentView.mas_top);
        make.bottom.mas_equalTo(self.contentView.mas_bottom);
    }];
    [_viewOfLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_image.mas_left);
        make.right.mas_equalTo(_image.mas_right);
        make.bottom.mas_equalTo(_image.mas_bottom);
        make.height.mas_equalTo(80);
    }];
    [_labelOfPrice mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_viewOfLabel.mas_left);
        make.right.mas_equalTo(_viewOfLabel.mas_right);
        make.height.mas_equalTo(25);
        make.top.mas_equalTo(_viewOfLabel.mas_top).mas_equalTo(10);
    }];
    [_labelOfContent mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_viewOfLabel.mas_left);
        make.right.mas_equalTo(_viewOfLabel.mas_right);
        make.height.mas_equalTo(25);
        make.bottom.mas_equalTo(_viewOfLabel.mas_bottom).mas_equalTo(-10);
    }];

}
@end
